<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setAttribute("basePath", basePath);
String respondResultJson= (String)request.getAttribute("respondResultJson");
%>
<html>
<head>
<title>病案系统-数据平台</title>
<link rel="stylesheet" href="${basePath}assets/bootstrap/css/bootstrap.css"/>
<link href="${basePath}assets/css/basic.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="${basePath}assets/css/list.css"/>
<link rel="stylesheet" href="${basePath}assets/css/login.css"/>
<script type="text/javascript" src="${basePath}assets/jquery/jquery.min.js"></script>
<script type="text/javascript" src="${basePath}assets/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="${basePath}assets/js/header.js"></script>
<script type="text/javascript" src="${basePath}assets/js/util.js"></script>
<script type="text/javascript" src="${basePath}assets/layer/layer.js"></script>
<script type="text/javascript" src="${basePath}assets/js/pagination/pagination_page.js"></script>
<script src="${basePath}assets/rotate/jquery.rotate.min.js"></script>
<link href="${basePath}assets/css/CatalogManage.css" rel="stylesheet" type="text/css"><%--
<link href="${basePath}/static/layer/layer_defined.css" rel="stylesheet" type="text/css"> --%>
<style>
.TM
{
	display: block;
	filter: alpha(opacity=10); /*IE*/
	-moz-opacity: 0.5; /*Mozilla*/
	opacity: 0.5; /*FF*/
}
#batchChooseTemplate a:hover {
	color:#6c6f6f;
	background:#a6c9e2;
}
</style>
<script type="text/javascript">
		function loadContent(url) {
			$("#mainContent").attr("src", url);
		}
		$(function(){
			var respondResultJson= <%=respondResultJson%>;
			console.log(respondResultJson);
			if(respondResultJson){
				if(!respondResultJson.success){
					if(respondResultJson.stateCode = "404"){
						layer.msg(respondResultJson.stateMessage);
					}
				}else{
					var record = respondResultJson['data'];
					var mrId =record['mr_id'];
					var visitNumber =record['visit_number'];
					var patientName =record['patient_name'];
					var outHospitalDate =record['out_hospital_date'];
					var title="姓名:"+patientName +"&nbsp;&nbsp;&nbsp;病案号:"+mrId+"&nbsp;&nbsp;&nbsp;住院次数:"+visitNumber+"&nbsp;&nbsp;&nbsp;出院日期:"+outHospitalDate;


					$("#title").html(title);
					$(".file_manage").removeAttr("hidden");
					initPage();

				}
			}
		});
	</script>

</head>
<body>
    <div class="file_manage" hidden="hidden">

    <div class="file_title">
    	<h3 id="title">标题</h3>
    	<input type="hidden" id="basePath" value="${basePath }"/>
    	<input type="hidden" id="visitGuid" value="${visitGuid }">
    	<form action="${basePath}medical_record_scan/paginationMedrecordImages" hidden="hidden"  id="paginationForm">
    		<input type="hidden" id="firstGuid" name="visitGuid" value="${visitGuid }">
    		<input type="hidden" id="paginationStatus" name="paginationStatus" value=""/>
    	</form>
        <input type="hidden" id="firstGuidHidden" value="${visitGuid}">
        <ul style="width:200px;">
            <li><a onclick="imagePaginationFinish()">完成编页</a></li>
            <li><a onclick="custom_close()" id="closeBtn2">关闭</a></li>
        </ul>
    </div>
    <div class="fileContent clearfix" >
        <div class="fileContent-left">
            <div class="file_header">
                <div class="left">文件信息&nbsp;&nbsp;
                <select onchange="paginationShow()" id="pagination" style="width:80px;" class="input_box">

                	<option selected="selected" value="1">未编页</option>
                	<option value="2">已编页</option>
                </select></div>
                <div class="right">总页数:&nbsp;<span id="totalFileCount">0</span>&nbsp;&nbsp; 未编页 &nbsp;<span id="unPaginationSpan">0</span></div>
            </div>
        <!--<h4 style="height:35px;line-height: 35px;width:965px;margin:0 0 5px;background:#e3e5e4;padding-left:25px;">文件对照信息</h4>-->
            <div class="filePage" id="filepage" style="height:1200px;">
                <ul id="image_url">
                	<li tabindex="100" hidden="hidden" style="position:relative" id="template_li" >
                		<img alt=""/>
               			<div style="position:absolute;top:0;right:0;"><a class="int" onclick="deleteImg(this)">删除</a></div>
               			<div style="position:absolute;top:0;right:5%;"><input style="width:50px;height:20px" type="input" value="${scanFile.sort_index}"/><a class="int" onclick="sortImage(this)">序列</a></div>
                	</li>
                	<c:forEach var="scanFile" items="${scanFiles }" varStatus="status">
                		<li tabindex="100" style="position:relative" id="${scanFile.image_id}" page-type-sort-index="${scanFile.page_type_sort_index}" image-sort-index="${scanFile.sort_index}" file-hash="${ scanFile.file_hash}">

                			<img src="${basePath}medical_record_scan/ajax_image_stream?fileHash=${scanFile.file_hash}" alt=""/>
                			<div style="position:absolute;top:0;right:0;"><a class="int" onclick="deleteImg(this)">删除</a></div>
                			<div style="position:absolute;top:0;right:5%;"><input style="width:50px;height:20px" type="input" value="${scanFile.sort_index}"/><a class="int" onclick="sortImage(this)">序列</a></div>
                		</li>

                	</c:forEach>
                </ul>
            </div>
        </div>

        <div class="file_menu">
        <div style="width:344px;height:40px;line-height:40px;color:#FFF;background-color:#1190e8;text-align:center;">病案编页管理</div>
        <ul class="clearfix" id=pageTypeList>
        	<c:forEach var="mrPageType" items="${mrPageTypes}" >
            	<li class="file_li" data-key-code="${mrPageType.keyCode }" style="overflow-y: hidden;" id="${mrPageType.pageTypeCode }" page-type-code="${mrPageType.pageTypeCode }" page-type-sort-index="${mrPageType.pageTypeSortIndex }" title="${mrPageType.pageTypeName}">

	            	<a>
	            		<c:if test="${not empty mrPageType.keyCode}">
	            			(${mrPageType.keyCode})
	            		</c:if>
		            	<span id="page-type-code${mrPageType.pageTypeCode}">
							${mrPageType.count}
						</span>
						${mrPageType.pageTypeName }
					</a>
				</li>
            </c:forEach>

        </ul>
    </div>
    </div>
</div>

<div class="modal fade" id="batchChooseTemplate" tabindex="-1" data-backdrop="static">
    <div class="modal-dialog" style="width: 1200px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">编页标签</h4>
            </div>
            <div class="modal-body" style="overflow: hidden;">
            	<input type="hidden" id="batchChooseTemplate_startIndex">
            	<input type="hidden" id="batchChooseTemplate_endIndex">
              	<ul style="width:1200px;">
		        	<c:forEach var="mrPageType" items="${mrPageTypes}"  varStatus="status">
		            	<li style="width:200px; height:30px; text-align:center;float: left;margin-right:10px;line-height:30px; color:#555555; font-size:14px; margin-bottom:10px;background: #F7F8F8;overflow-y: hidden;" title="${mrPageType.pageTypeName}">
			            	<a style="width: 100%;display: block;" href="javascript:submitBatchPaginantion(${mrPageType.pageTypeCode},&quot;${mrPageType.pageTypeName }&quot;)">${mrPageType.pageTypeName }</a>
						</li>
		            </c:forEach>
	       		</ul>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
</body>
</html>
